package cn.tedu.csmall.product.mapper;

import cn.tedu.csmall.product.pojo.VO.BrandCategoryListVO;
import cn.tedu.csmall.product.pojo.VO.BrandCategoryStandardVO;
import cn.tedu.csmall.product.pojo.entity.BrandCategory;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface BrandCategoryMapper {
    /**
     * 插入品牌与类别关联数据
     *
     * @param brandCategory 品牌与类别关联数据
     * @return 受影响行数
     */
    int insert(BrandCategory brandCategory);

    /**
     * 批量插入品牌与类别关联数据
     *
     * @param brandCategories 品牌与类别关联数据
     * @return 受影响行数
     */
    int insertBatch(List<BrandCategory> brandCategories);

    int deleteById(Long id);

    int deleteByIds(Long[] ids);

    int update(BrandCategory brandCategory);

    int count();

    int countByBrand(@Param("brandId") Long brandId);

    int countByCategory(@Param("categoryId") Long categoryId);

    int countByBrandAndCategory(@Param("brandId") Long brandId, @Param("categoryId") Long categoryId);

    BrandCategoryStandardVO getStandardById(Long id);

    List<BrandCategoryListVO> list();
}
